<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserBankCardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_bank_cards', function (Blueprint $table) {
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
            $table->comment = '用户添加银行卡信息表';
            $table->increments('id');
            $table->unsignedInteger('uid')->index()->comment('用户id');
            $table->string('card_username',255)->comment('持卡人姓名');
            $table->char('card_num',25)->comment('银行卡号码，通常19位');
            $table->char('phone_num',11)->comment('银行卡预留手机号');
            $table->string('bank_name','255')->comment('银行卡名称');
            $table->string('bank_name_show',255)->comment('银行展示名称');
            $table->string('bank_code',255)->comment('银行编码');
            $table->unsignedTinyInteger('is_credit')->default(1)->comment('是否是信用卡:1是2否3未知类型');
            $table->string('hold_agreement_num',255)->comment('协议号');
            $table->string('order_num',255)->comment('请求编号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_bank_cards');
    }
}
